<template>
  <div class="item">
    <div v-if="$attrs.data.children">
      <el-submenu :index="$attrs.data.children.id">
        <template slot="title">{{ $attrs.data.children.label }}</template>
        <item :data="$attrs.data.children"></item>
      </el-submenu>
    </div>
    <div v-else>
      <el-submenu :index="$attrs.data.id">
        <el-menu-item :index="$attrs.data.id">{{
          $attrs.data.label
        }}</el-menu-item>
      </el-submenu>
    </div>
  </div>
</template>

<script>
export default {
  name: "item",
};
</script>

<style></style>
